<!--  @author:ymy  -->
<template>
  <div class="content">
    <div class="content-items">
      <div class="content-title">
        <h3>{{ items.title }}</h3>
        <p v-show="items.secTitle !== ''">{{ items.secTitle }}<van-icon name="arrow" /></p>
      </div>
      <div class="content-item" v-for="item in items.data" :key="item.id">
        <div class="item-img">
          <img :src="'https://ss.lanqb.com/' + item.posters.app" alt="" />
        </div>
        <div class="item-right">
          <div class="item-text">
            <h3>{{ item.title }}</h3>
            <div class="item-userinfo">
              <div class="user">
                <img :src="'https://ss.lanqb.com/' + item.profile.avatar" alt="" />
                <p>{{ item.profile.nickname }}</p>
              </div>
              <p>共{{ item.preview_setting.lessons_count }}节</p>
            </div>
          </div>
          <div class="item-text1">
            <span>{{ item.study_num }}人在学</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Content',
  data() {
    return {};
  },
  props: ['items'],
};
</script>
<style lang="less" scoped>
.content {
  background-color: white;
  width: 100vw;
  margin-top: 0.2rem;

  > .content-items {
    > .content-title {
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 0.22rem;
      width: 3.43rem;
      margin: 0 auto;
      > h3 {
        font-size: 0.17rem;
        font-weight: normal;
      }
      > p {
        font-size: 0.13rem;
        color: #a4a4a4;
      }
    }
    > .content-item {
      width: 3.43rem;
      height: 1.125rem;
      display: flex;
      justify-content: space-between;
      margin: 0.16rem auto 0;
      > .item-img {
        img {
          width: 1.5rem;
          height: 1.125rem;
        }
      }
      > .item-right {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        margin-left: 0.12rem;
        > .item-text {
          h3 {
            font-size: 0.14rem;
            font-weight: normal;
          }
          > .item-userinfo {
            margin-top: 0.08rem;
            display: flex;
            height: 0.18rem;
            line-height: 0.18rem;
            justify-content: space-between;
            font-size: 0.13rem;
            vertical-align: middle;
            > .user {
              img {
                width: 0.18rem;
                height: 0.18rem;
                border-radius: 50%;
                vertical-align: middle;
              }
              p {
                display: inline-block;
                height: 18px;
                line-height: 0.18rem;
                font-size: 0.13rem;
              }
            }
          }
        }
        > .item-text1 {
          span {
            font-size: 0.13rem;
            color: #8c8c8c;
          }
        }
      }
    }
  }
}
</style>
